#  Copyright 2022 Deep Learning on Flink Authors
# 
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import node_pb2 as node__pb2


class NodeServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.GetNodeSpec = channel.unary_unary(
        '/NodeService/GetNodeSpec',
        request_serializer=node__pb2.NodeSpecRequest.SerializeToString,
        response_deserializer=node__pb2.NodeSpecResponse.FromString,
        )
    self.NodeRestart = channel.unary_unary(
        '/NodeService/NodeRestart',
        request_serializer=node__pb2.NodeRestartRequest.SerializeToString,
        response_deserializer=node__pb2.NodeRestartResponse.FromString,
        )
    self.NodeStop = channel.unary_unary(
        '/NodeService/NodeStop',
        request_serializer=node__pb2.NodeStopRequest.SerializeToString,
        response_deserializer=node__pb2.NodeStopResponse.FromString,
        )
    self.GetContext = channel.unary_unary(
        '/NodeService/GetContext',
        request_serializer=node__pb2.ContextRequest.SerializeToString,
        response_deserializer=node__pb2.ContextResponse.FromString,
        )
    self.GetFinishWorker = channel.unary_unary(
        '/NodeService/GetFinishWorker',
        request_serializer=node__pb2.NodeSimpleRequest.SerializeToString,
        response_deserializer=node__pb2.FinishWorkerResponse.FromString,
        )
    self.FinishJob = channel.unary_unary(
        '/NodeService/FinishJob',
        request_serializer=node__pb2.NodeSimpleRequest.SerializeToString,
        response_deserializer=node__pb2.NodeSimpleResponse.FromString,
        )


class NodeServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def GetNodeSpec(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def NodeRestart(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def NodeStop(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetContext(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetFinishWorker(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def FinishJob(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_NodeServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'GetNodeSpec': grpc.unary_unary_rpc_method_handler(
          servicer.GetNodeSpec,
          request_deserializer=node__pb2.NodeSpecRequest.FromString,
          response_serializer=node__pb2.NodeSpecResponse.SerializeToString,
      ),
      'NodeRestart': grpc.unary_unary_rpc_method_handler(
          servicer.NodeRestart,
          request_deserializer=node__pb2.NodeRestartRequest.FromString,
          response_serializer=node__pb2.NodeRestartResponse.SerializeToString,
      ),
      'NodeStop': grpc.unary_unary_rpc_method_handler(
          servicer.NodeStop,
          request_deserializer=node__pb2.NodeStopRequest.FromString,
          response_serializer=node__pb2.NodeStopResponse.SerializeToString,
      ),
      'GetContext': grpc.unary_unary_rpc_method_handler(
          servicer.GetContext,
          request_deserializer=node__pb2.ContextRequest.FromString,
          response_serializer=node__pb2.ContextResponse.SerializeToString,
      ),
      'GetFinishWorker': grpc.unary_unary_rpc_method_handler(
          servicer.GetFinishWorker,
          request_deserializer=node__pb2.NodeSimpleRequest.FromString,
          response_serializer=node__pb2.FinishWorkerResponse.SerializeToString,
      ),
      'FinishJob': grpc.unary_unary_rpc_method_handler(
          servicer.FinishJob,
          request_deserializer=node__pb2.NodeSimpleRequest.FromString,
          response_serializer=node__pb2.NodeSimpleResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'NodeService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
